package com.ly.mpayment.persist.service.timer;

import com.ly.mpayment.persist.entity.ProductPriceUp;
import com.ly.mpayment.persist.service.AbstractService;
import org.springframework.stereotype.Service;

import java.io.Serializable;
import java.util.List;

@Service
public class ProductPriceUpServiceImpl extends AbstractService<ProductPriceUp, Serializable> implements ProductPriceUpService {

    @Override
    public void saveProductPrice(ProductPriceUp price) {
        this.saveOrUpdate(price);
    }

    @Override
    public List<ProductPriceUp> detailProductTimerAll(String proId) {

        return this.find("select p from ProductPriceUp p left join fetch p.productId where p.proId.id = ? order by p.upName, p.beforeValue",proId);
    }
}
